import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';
import { defineConfig } from 'eslint/config';
import prettier from 'eslint-plugin-prettier';

export default defineConfig([
    {
        files: ['**/*.{js,mjs,cjs,ts,mts,cts,vue}'],
        plugins: { js, prettier },
        extends: [
            'js/recommended',
            // "plugin:@typescript-eslint/recommended",
            // "plugin:vue/vue3-essential",
            'plugin:prettier/recommended'
        ],
        languageOptions: { globals: globals.browser },
        rules: {
            'prettier/prettier': 'error'
        }
    },
    tseslint.configs.recommended,
    pluginVue.configs['flat/essential'],
    {
        files: ['**/*.vue'],
        languageOptions: {
            parserOptions: { parser: tseslint.parser }
        }
    }
]);
